<template>
  <div>
    <ul>
      <li><button @click="handleClick">去往HelloSetup</button></li>
      <li><button @click="handlePrint">打印参数</button></li>
      <!-- <li><router-link to="/setup/parent">父子传值</router-link></li>
      <li><router-link to="/setup/store">状态管理</router-link></li> -->
    </ul>
  </div>
</template>

<script lang="ts" setup>
import { useRoute, useRouter } from "vue-router";

let router = useRouter();
let route = useRoute();

function handleClick() {
    router.push("/setup/hello");
}

function handlePrint() {
    console.log("name = ",route.query.name);
    console.log("age = ",route.query.age);
}

</script>
<!-- <script lang="ts">
export default {
    // 组件内前置守卫
    beforeRouteEnter(to,from,next) {
        console.log("我进来了！！！！");
        next();
    }
}
</script> -->
<style>
</style>